package org.assocsp3.service.impl;

import java.util.List;

import org.assocsp3.dao.ActiviteDao;
import org.assocsp3.modele.Activite;
import org.assocsp3.service.ActiviteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ActiviteServiceImpl implements ActiviteService{
	
	private ActiviteDao dao;
    
	@Autowired
    public ActiviteServiceImpl(ActiviteDao dao) {
        this.dao = dao;
    }
	
	public void ajouter(Activite o) {
		dao.insert(o);		
	}

	public List<Activite> findAll() {	
		return dao.findAll();
	}

	public Activite findById(int id) {
		return dao.findById(id);
	}
	
	public List<Activite> findByExample(Activite u) {
		return dao.findByExample(u);
	}

	public void mettre_a_jour(Activite o) {
		dao.update(o);		
	}

	public void supprimer(Activite o) {
		dao.delete(o);		
	}

}